var AddWeaponTimeoutIndicator = function (tank) {
    var oRender = tank.render;
    tank.weaponTimeoutIndicatorEnabled = true;
    tank.render = function (drawEngine) {
        oRender.apply(this, [drawEngine]);
        if (!this.weaponTimeoutIndicatorEnabled) return;
        var OffsetY = -1;
        var rectHeight = 4;

        var context = drawEngine.ctx;

        // draw outside rectangle
        context.beginPath();
        context.rect(this.x, this.y + OffsetY, this.width, rectHeight);
        context.fillStyle = 'black';
        context.fill();
        context.lineWidth = 1;
        context.strokeStyle = 'black';
        context.stroke();

        // draw inside rectangle
        context.beginPath();
        context.rect(this.x + 1, this.y + OffsetY + 1, Math.round((this.width - 1) * this.__weaponTimeout / this.weaponTimeout), rectHeight - 2);
        context.fillStyle = 'red';
        context.fill();
    };
    return tank;
};